import 'package:lcapp/data/location_data_entity.dart';

locationDataEntityFromJson(LocationDataEntity data, Map<String, dynamic> json) {
	if (json['country'] != null) {
		data.country = json['country'].toString();
	}
	if (json['province'] != null) {
		data.province = json['province'].toString();
	}
	if (json['city'] != null) {
		data.city = json['city'].toString();
	}
	if (json['district'] != null) {
		data.district = json['district'].toString();
	}
	if (json['street'] != null) {
		data.street = json['street'].toString();
	}
	if (json['streetNumber'] != null) {
		data.streetNumber = json['streetNumber'].toString();
	}
	if (json['cityCode'] != null) {
		data.cityCode = json['cityCode'].toString();
	}
	if (json['adCode'] != null) {
		data.adCode = json['adCode'].toString();
	}
	if (json['address'] != null) {
		data.address = json['address'].toString();
	}
	if (json['errorCode'] != null) {
		data.errorCode = json['errorCode'].toString();
	}
	if (json['errorInfo'] != null) {
		data.errorInfo = json['errorInfo'].toString();
	}
	if (json['locationType'] != null) {
		data.locationType = json['locationType'].toString();
	}
	if (json['latitude'] != null) {
		data.latitude = json['latitude'].toString();
	}
	if (json['longitude'] != null) {
		data.longitude = json['longitude'].toString();
	}
	if (json['accuracy'] != null) {
		data.accuracy = json['accuracy'].toString();
	}
	if (json['locationTime'] != null) {
		data.locationTime = json['locationTime'].toString();
	}
	if (json['callbackTime'] != null) {
		data.callbackTime = json['callbackTime'].toString();
	}
	if (json['coordinate'] != null) {
		data.coordinate = json['coordinate'].toString();
	}
	return data;
}

Map<String, dynamic> locationDataEntityToJson(LocationDataEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['country'] = entity.country;
	data['province'] = entity.province;
	data['city'] = entity.city;
	data['district'] = entity.district;
	data['street'] = entity.street;
	data['streetNumber'] = entity.streetNumber;
	data['cityCode'] = entity.cityCode;
	data['adCode'] = entity.adCode;
	data['address'] = entity.address;
	data['errorCode'] = entity.errorCode;
	data['errorInfo'] = entity.errorInfo;
	data['locationType'] = entity.locationType;
	data['latitude'] = entity.latitude;
	data['longitude'] = entity.longitude;
	data['accuracy'] = entity.accuracy;
	data['locationTime'] = entity.locationTime;
	data['callbackTime'] = entity.callbackTime;
	data['coordinate'] = entity.coordinate;
	return data;
}